//
//  WLFileHandle.h
//  WanLian
//
//  Created by 123456 on 2018/12/9.
//  Copyright © 2018 wanlian. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <AVFoundation/AVFoundation.h>
NS_ASSUME_NONNULL_BEGIN

@interface WLFileHandle : NSObject


+ (void) convertVideoQuailtyWithInputURL:(NSURL*)inputURL
                               outputURL:(NSURL*)outputURL
                         completeHandler:(void (^)(AVAssetExportSession*))handler;

+ (void) convertImageQuailtyWithInputURL:(NSURL*)inputURL
                               outputURL:(NSURL*)outputURL
                         completeHandler:(void (^)(AVAssetExportSession*))handler;
/**判断文件(夹)是否存在*/
+ (BOOL)isExistsAtPath:(NSString *)path;
/*参数1、被复制文件路径
 *参数2、要复制到的目标文件路径
 *参数3、当要复制到的文件路径文件存在，会复制失败，这里传入是否覆盖
 *参数4、错误信息
 */
+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite error:(NSError *__autoreleasing *)error;

/*参数1：文件路径
 *参数2：文件内容
 *参数3：错误信息
 */
+ (BOOL)writeFileAtPath:(NSString *)path content:(NSObject *)content error:(NSError *__autoreleasing *)error;

+ (NSNumber *)sizeOfItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error;

/** 获取视频的文件 */
+ (void) thumbnailImageForVideo:(NSURL *)videoURL atTime:(NSTimeInterval)time completeBlock:(void (^)(UIImage *image))complete;

+ (BOOL)removeItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error;
+ (BOOL)createFileAtPath:(NSString *)path overwrite:(BOOL)overwrite error:(NSError *__autoreleasing *)error;
/**获取沙盒中Documents的目录路径*/
+ (NSString *)documentsDir;
@end

NS_ASSUME_NONNULL_END
